package com.pro.controller;

import com.pro.pojo.JsUserFeedback;
import com.pro.pojo.JsonData;
import com.pro.service.JsUserFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/JsUserFeedback")
public class JsUserFeedbackController {
    @Autowired
    JsUserFeedbackService jufs;
    @RequestMapping(value="/getAllFeedbackStatus")
    @ResponseBody
    public JsonData getAllFeedbackStatus(JsUserFeedback param){
        List<JsUserFeedback> allFeedbackStatus = jufs.getAllFeedbackStatus(param);
        return allFeedbackStatus != null?JsonData.buildSuccess(allFeedbackStatus):JsonData.buildError("服务器异常");
    }
    @RequestMapping(value="/getAllFeedbackStatus24")
    @ResponseBody
    public JsonData getAllFeedbackStatus24(JsUserFeedback param){
        List<JsUserFeedback> getAllFeedbackStatus24 = jufs.getAllFeedbackStatus24(param);
        return getAllFeedbackStatus24 != null?JsonData.buildSuccess(getAllFeedbackStatus24):JsonData.buildError("服务器异常");
    }
    @RequestMapping(value="/updateByIdStatus")
    @ResponseBody
    public JsonData updateByIdStatus(Integer feedbackId, String updateId, String updateDate){
        boolean b = jufs.updateByIdStatus(feedbackId,updateId,updateDate);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器异常");
    }
    @RequestMapping(value="/deleteByIdFeedback")
    @ResponseBody
    public JsonData deleteByIdFeedback(Integer feedbackId){
        boolean b = jufs.deleteByIdFeedback(feedbackId);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器异常");
    }
}
